/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>

#import "OFXObject.h"
#import "OFXCurrency.h"
#import "OFXSecurity.h"
#import "OFXInvestmentAccount.h"

@interface OFXInvestmentOpenOrder : OFXObject {
  NSString* uniqueId;
  NSString* serverTransactionId;
  OFXSecurity* security;
  NSDate* datePlaced;
  NSNumber* units;
  NSString* subAccount;
  NSString* orderType;
  NSString* orderDuration;
  NSString* orderRestrictions;
  NSNumber* minUnits;
  NSNumber* limitPrice;
  NSNumber* stopPrice;
  NSString* memo;
  NSString* investment401kSource;
  OFXCurrency* currency;
}

/**
 * @property uniqueId
 * @brief Unique, financial institution assigned, transaction ID
 */
@property(retain) NSString* uniqueId;

/**
 * @property serverTransactionId
 * @brief Unique server-assigned transaction ID
 */
@property(retain) NSString* serverTransactionId;

/**
 * @property security
 * @brief Security involved in order
 */
@property(retain) OFXSecurity* security;

/**
 * @property datePlaced
 * @brief Date-time the order was placed
 */
@property(retain) NSDate* datePlaced;

/**
 * @property units
 * @brief Quantity of the security the open order is for
 */
@property(retain) NSNumber* units;

/**
 * @property subAccount
 * @brief Sub-account type: CASH, MARGIN, SHORT, OTHER
 */
@property(retain) NSString* subAccount;

/**
 * @property orderType
 * @brief Type of order
 */
@property(retain) NSString* orderType;

/**
 * @property orderDuration
 * @brief How long the order is good for: DAY, GOODTILCANCEL, IMMEDIATE
 */
@property(retain) NSString* orderDuration;

/**
 * @property orderRestrictions
 * @brief Special restriction on the order: ALLORNONE, MINUNITS, NONE
 */
@property(retain) NSString* orderRestrictions;

/**
 * @property minUnits
 * @brief Minimum number of units that must be filled for the order
 */
@property(retain) NSNumber* minUnits;

/**
 * @property limitPrice
 * @brief Limit price
 */
@property(retain) NSNumber* limitPrice;

/**
 * @property stopPrice
 * @brief Stop price
 */
@property(retain) NSNumber* stopPrice;

/**
 * @property memo
 * @brief Comments / Other information about order
 */
@property(retain) NSString* memo;

/**
 * @property investment401kSource
 * @brief For 401(k) accounts, source of money used for this security. 
 * 
 * Must be one of the following:
 * - PRETAX 
 * - AFTERTAX 
 * - MATCH 
 * - PROFITSHARING 
 * - ROLLOVER 
 * - OTHERVEST 
 * - OTHERNONVEST
 * 
 * Default if not present is OTHERNONVEST. The following cash source types are
 * subject to vesting: MATCH, PROFITSHARING, and OTHERVEST.
 */
@property(retain) NSString* investment401kSource;

/**
 * @property currency
 * @brief Currency values are expressed in.
 */
@property(retain) OFXCurrency* currency;

@end
